package com.jt.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class ImageVO {

    //
    private Integer error; //错误信息  0程序运行正常 1 文件上传有误
    private String url;  //图片访问的虚拟路径
    private Integer width;
    private Integer height;

    //设定上传失败的方法
    public static ImageVO fail(){

        return new ImageVO(1,null,null,null);
    }

    public static ImageVO success(String url,Integer width ,Integer height){

        return new ImageVO(0,url,width,height);
    }
}
